package com.car.carmgr.mapper;

import com.car.carmgr.bean.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    User login(User user);

    int insertUser(User user);

    int deleteUserById(Integer userId);

    int updateUser(User user);

    /*重置密码*/
    int resetUserPwd(Integer userId);

    /**
     * 查询用户
     */
    List<User> findUserByWhere(@Param("loginName") String loginName,@Param("realName") String realName,@Param("identity") String identity,@Param("address") String address,@Param("phone") String phone,@Param("sex") Integer sex);

    Integer getCountByWhere(@Param("loginName") String loginName,@Param("realName") String realName,@Param("identity") String identity,@Param("address") String address,@Param("phone") String phone,@Param("sex") Integer sex);

    int delRoleUserByUserId(Integer id);
    int insRoleUserByUserId(@Param("userId") Integer userId , @Param("rids") Integer[] rids);


}
